package org.crazyit.activiti_d3._3_Name;

import org.activiti.engine.ProcessEngine;
import org.activiti.engine.ProcessEngineConfiguration;
import org.activiti.engine.ProcessEngines;

public class Name {

    public static void main(String[] args) {

        //1. 读取配置
        ProcessEngineConfiguration config = ProcessEngineConfiguration.createProcessEngineConfigurationFromResource("name.xml");

        //2. 设置流程引擎名称
        config.setProcessEngineName("test");

        //3. 创建流程引擎
        ProcessEngine engine = config.buildProcessEngine();

        //4. 根据名称查询流程引擎
        ProcessEngine engineTest = ProcessEngines.getProcessEngine("test");
        System.out.println("创建的引擎实例:" + engine);
        System.out.println("查询的引擎实例:" + engineTest);

    }

}
